<%Const respagecode="complaints_edit"%><% 'UTF-8%>
<%''加载通用函数和数据库连接%>
<!--#include file="../Include/Start.asp"-->
<%'检查是否登录%>
<!--#include file="../Include/checklogin.asp"-->


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 	<!--meta信息-->
	<!--#include file="../Include/meta.asp"-->
	<!--end meta-->

	<link href="../css/css-1.05.css" rel="stylesheet" type="text/css" />
	<link href="../css/console-1.03.css" rel="stylesheet" type="text/css" />
	<link href="../css/calendar.css" rel="stylesheet" type="text/css" />
	<link href="../css/console_home-1.06.css" rel="stylesheet" type="text/css" />
	
	<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
	<script type="text/javascript" src="../js/jquery.extend-1.06.js"></script>
	<script type="text/javascript" src="../js/common_1.01.js"></script>
	<script type="text/javascript" src="../js/calendar/WdatePicker.js"></script>
	<script type="text/javascript" src="../js/menu.js"></script>
	<script type="text/javascript" src="../js/TrimPathTemplate.js"></script>
	<script type="text/javascript" src="../js/console_complaints.js"></script>
</head>

<body>
<div class="wrapper">

	<!--header页头信息-->
	<!--#include file="../Include/header.asp"-->
	<!--end header页头信息-->


	<!--navigation菜单信息-->
	<!--#include file="../Include/navigation.asp"-->
	<script type="text/javascript">
		/*选中该tab页 需要tab页上有ID*/
		$("#complaints").attr("className","on")
		$("#navigation").menu('point');
	</script>
	<!--end navigation菜单信息-->

<!--begin container-->
<div class="container" id="container">
	<!--<div class="c_left">
		<h2>权限管理</h2>
		<ul>
			<li><h3><a href="/admin/users.asp">用户</a></h3></li>
			<li><h3><a href="/admin/roles.asp">角色</a></h3></li>
			<li class="on"><h3><a href="/admin/resources.asp">资源</a></h3></li>
		</ul>
	</div>-->
	<div class="c_left">
		<!--begin left_menu 左侧菜单信息-->
		<!--#include file="../Include/left_menu.asp"-->
		<!--end left_menu 左侧菜单信息-->	
	</div>
	<div class="c_right">
		<div class="c_r_head">
			<ul class="head_tab">
				<li><h4><a href="complaints.asp##div_tab_list">投诉单记录</a></h4></li>
				<li class="on"><h4><a href="#">修改</a></h4></li>
				<li><h4><a href="complaints.asp##div_tab_add">新增</a></h4></li>
			</ul>
		</div>	
	<%
		''定义查询字段变量
		''id, 申诉者姓名, 申诉者性别, 申诉者联系电话, 申诉者通信地址, 申诉者电子邮箱, 
	 	''被申诉方ID, 申诉类别, 申诉名称, 品牌, 型号, 价格, 凭证, 消费日期, 争议金额, 简述, 
	  	''问题分类, 数量, 状态, 申诉要求, 受理人, 受理时间, 处理结果,消息来源,受理人
		dim cid ,sszxm,sszxb,sszlxdh,ssztxfs,sszdzyx,bssfid,sslb,ssmc
		dim pp,xh,jg,pz,xfrq,zyje,js,wtfl,wtflA,sl,zt,ssyq,slr,slsj,cljg,xxly ,slr_name
		dim spfl,spflA,spflB
	 
		cid=ReplaceBadChar(Trim(request("id")))
		if(""=cid) then response.redirect "/complaints.asp" ''如果id并没有传来跳转回原处
		''Dim rsObj,strSql
		set rsObj=Server.CreateObject("ADODB.Recordset")
		strSql = "Select  uew.*  "
		strSql =  strSql & " ,PE_User.TrueName ,efv.TrueName as build_user  "		
		strSql =  strSql & " FROM [T_登记单] uew  "		
		strSql =  strSql & " INNER JOIN PE_User ON uew.被申诉方ID = PE_User.Userid  "		
		strSql =  strSql & " INNER JOIN PE_User efv ON uew.受理人 = efv.userid  "		
		strSql=strSql & "   where uew.id='"&cid&"' "
		
		''Response.Write strSql & "-----"
		rsObj.Open strSql, Conn, 1, 3
		If rsObj.BOF And rsObj.EOF Then 
			 response.redirect "/complaints.asp" ''如果id并没有传来跳转回原处
		end if	 
		cid=Trim(rsObj("id"))
		sszxm=rsObj("申诉者姓名")
		sszxb=rsObj("申诉者性别")
		sszlxdh=rsObj("申诉者联系电话")
		ssztxdz=rsObj("申诉者通信地址")
		sszdzyx=rsObj("申诉者电子邮箱")
		
		xxly=rsObj("消息来源")
		bssfid=rsObj("被申诉方ID")
		sslb=rsObj("申诉类别")
		ssmc=rsObj("申诉名称")
		
		pp=rsObj("品牌")
		xh=rsObj("型号")
		jg=rsObj("价格")
		pz=rsObj("凭证")
		
		xfrq=rsObj("消费日期")
		zyje=rsObj("争议金额")
		js=rsObj("简述")
		
		wtfl=rsObj("问题分类")
		wtflA=rsObj("问题分类A")
		spfl=rsObj("商品分类")
		spflA=rsObj("商品分类A")
		spflB=rsObj("商品分类B")
					
		sl=rsObj("数量")
		ssyq=rsObj("申诉要求")
		slr_name=rsObj("TrueName")''受理人真名
		slr=rsObj("受理人")
	
		''Response.Write wtfl&"---wtfl--<br>" 
		''关闭链接
		rsObj.close		

	%>	
		
		<div class="c_r_body" id="div_tab_edit" name="div_tab_edit">
			<form id="form_edit" action="complaints_do.asp" method="post">
				<input id="cid" name="cid" type="hidden" value="<%=cid%>" />
				<div align="center" style="height:25px">
					请输入详细信息
				</div>
				<table width="100%" border="0" cellpadding="2" cellspacing="4" style="margin:auto">
					<tr class="line">
                         <td colspan="4">[申诉者信息]<div/></td>
                    </tr>	 
					<tr>
						<td align="right">申诉者姓名:</td>
						<td><input id="sszxm" name="sszxm" value="<%=sszxm%>" type="text" maxlength="30" class="text" style="width:100px"/></td>
						<td align="right">申诉者性别:</td>
						<td><input id="sszxb_txt" name="sszxb_txt" value="" type="hidden"/><%	
						Response.Write GetSelectHtml("sex","sszxb",sszxb,Conn,"style='width: 100px; margin-right: -4px;'  class='success'",0)''生成下拉条
						%></td>
					</tr>
					<tr>
						<td align="right">申诉者联系电话:</td>
						<td><input id="sszlxdh" name="sszlxdh" value="<%=sszlxdh%>" type="text" maxlength="30" class="text" style="width:100px"/></td>
						<td align="right">申诉者通信地址:</td>
						<td><input id="ssztxdz" name="ssztxdz" value="<%=ssztxdz%>" type="text" maxlength="30" class="text" style="width:100px"/></td>
					</tr>
					<tr>
						<td align="right">申诉者电子邮箱:</td>
						<td><input id="sszdzyx" name="sszdzyx" value="<%=sszdzyx%>" type="text" maxlength="30" class="text" style="width:100px"/></td>
						<td align="right">消息来源</td>
						<td><input id="xxly_txt" name="xxly_txt" value="" type="hidden"/><%		
						Response.Write GetSelectHtml("xxly","xxly",xxly,Conn,"style='width: 100px; margin-right: -4px;'  class='success'",0)''生成下拉条
						%></td>
					</tr>
					<tr class="line">
                       <td colspan="4">[被申诉方信息]<div/></td>
                    </tr>
					<tr>
						<td align="right">被申诉方:</td>					
						<td>
							<select style="width: 156px; margin-right: -4px;" id="bssfid" name="bssfid" class="success">
							<%		
								set rsObj=Server.CreateObject("ADODB.Recordset")
								strSql = "SELECT * FROM PE_User WHERE (UserType = 2)  "
								''Response.Write strSql & "-----"
								rsObj.Open strSql, Conn, 1, 3			 
								do while not rsObj.eof
								%>
									<option <%if Trim(rsObj("UserID"))=bssfid then Response.Write "selected"%> value="<%=Trim(rsObj("UserID"))%>" label="<%=Trim(rsObj("TrueName"))%>"><%=Trim(rsObj("TrueName"))%></option>
								<%
								rsObj.movenext
								loop 
								''关闭链接
								rsObj.close	
								%>
							</select>
						</td>
						<td align="right">受理人:</td>
						<td><%=slr_name%><input id="slr" name="slr" value="<%=slr%>" type="hidden" /></td>
					</tr>
					<tr class="line">
                       <td colspan="4">[申诉内容]<div/></td>
                    </tr>
					<tr>
						<td align="right">申诉类别:</td>
						<td>
						<select id="sslb" name="sslb" style="width: 100px; margin-right: -4px;"  class="success">
							<option <%if "商品"=sslb then Response.Write "selected"%> value="商品" label="商品">商品</option>
							<option <%if "服务"=sslb then Response.Write "selected"%> value="服务" label="服务">服务</option> 
						</select></td>
						<td align="right">申诉名称:</td>
						<td><input id="ssmc" name="ssmc" value="<%=ssmc%>" type="text" maxlength="30" class="text" style="width:100px"/></td>
					</tr>
					<tr>
						<td align="right">品牌:</td>
						<td><input id="pp" name="pp" value="<%=pp%>" type="text" maxlength="30" class="text" style="width:100px"/></td>
						<td align="right">型号:</td>
						<td><input id="xh" name="xh" value="<%=xh%>" type="text" maxlength="30" class="text" style="width:100px"/></td>
					</tr>
					<tr>
						<td align="right">价格:</td>
						<td><input id="jg" name="jg" value="<%=jg%>" type="text" maxlength="30" class="text" style="width:100px"/></td>
						<td align="right">凭证:</td>
						<td><input id="pz" name="pz" value="<%=pz%>" type="text" maxlength="50" class="text" style="width:100px"/></td>
					</tr>
					<tr>
						<td align="right">消费日期:</td>
						<td><input id="xfrq" name="xfrq" type="text" maxlength="10" value="<%=xfrq%>" onfocus="WdatePicker({el:this})" style="width: 90px;"  class="text Wdate" realvalue="<%=date()%>"/></td>
						<td align="right">争议金额:</td>
						<td><input id="zyje" name="zyje" value="zyje" type="text" maxlength="30" class="text" style="width:100px"/></td>
					</tr>
					<tr>
						<td align="right">数量:</td>
						<td><input id="sl" name="sl" value="<%=sl%>" type="text" maxlength="30" class="text" style="width:100px"/></td>
						<td align="right">问题分类:</td>
						<td>
						<%		
							Response.Write GetSelectHtml("wtfl","wtfl",wtfl,Conn,"style='width: 100px; margin-right: -4px;'  class='success'",true)''生成下拉条
						%><input id="wtfl_txt" name="wtfl_txt" type="hidden" value=""/><%		
							Response.Write   GetSelectHtmlByPid(wtfl,"wtflA",wtflA,Conn,"style='width: 100px; margin-right: -4px;'  class='success'",true)''生成下拉条
						%><input id="wtflA_txt" name="wtflA_txt" value="" type="hidden"/>
						</td>
					</tr>
					<tr>
						<td align="right">商品分类:</td>
						<td>
						<%		
							Response.Write GetSelectHtml("spfl","spfl",spfl,Conn,"style='width: 100px; margin-right: -4px;'  class='success'",true)''生成下拉条
						%><input id="spfl_txt" name="spfl_txt" type="hidden" value=""/><%		
							Response.Write   GetSelectHtmlByPid(spfl,"spflA",spflA,Conn,"style='width: 100px; margin-right: -4px;'  class='success'",true)''生成下拉条
						%><input id="spflA_txt" name="spflA_txt" value="" type="hidden"/><%		
							Response.Write   GetSelectHtmlByPid(spflA,"spflB",spflB,Conn,"style='width: 100px; margin-right: -4px;'  class='success'",true)''生成下拉条
						%><input id="spflB_txt" name="spflB_txt" value="" type="hidden"/>
						</td>
						<td align="right"></td>
						<td></td>
					</tr>
					<tr class="line">
                        <td colspan="4"><div/></td>
                    </tr>
					<tr>
						<td align="right">简述:</td>
						<td colspan="3"><textarea rows="4" cols="90" id="js" name="js"><%=js%></textarea></td>
					</tr>
					<tr class="line">
                        <td colspan="4"><div/></td>
                    </tr>
					<tr>
						<td align="right">申诉要求:</td>
						<td colspan="3">
							<%		
							set rsObj=Server.CreateObject("ADODB.Recordset")
							strSql=""
							strSql = strSql & " SELECT mm.checked AS checked, nn.* "
							strSql = strSql & " FROM (SELECT tt.*, 'checked' AS checked FROM T_数据字典 tt "
							strSql = strSql & "WHERE 1=2   "
							if (""<>ssyq) then strSql = strSql & " or id IN ("& ssyq &") "
							strSql = strSql & ") mm RIGHT OUTER JOIN T_数据字典 nn ON mm.id = nn.id "
							strSql = strSql & "WHERE (nn.code = 'ssyq') ORDER BY nn.sort_num "
       
							''Response.Write strSql & "-----"
							rsObj.Open strSql, Conn, 1, 3	
							dim kk 	
							kk=0	 
							do while not rsObj.eof
								if (0=k mod 5) then Response.Write "<br>"
								k=k+1
								%>
								<input type="checkbox" value='<%=Trim(rsObj("id"))%>' <%=Trim(rsObj("checked"))%> name="id_all" id="id_all"/><%=Trim(rsObj("c_txt"))%>&nbsp;
								<%
								rsObj.movenext
							loop 
							''关闭链接
							rsObj.close	
							%>
						</td>
					</tr>

					<tr class="line">
                        <td colspan="4"><div/></td>
                    </tr>
		 				
					<tr>
						<td align="right"> </td>
						<td><input name="" type="submit" value="修改保存" />&nbsp;<label id="result"></label></td>
					</tr>
				</table>
			</form>
		</div>
	</div>

	<script type="text/javascript">
	 
		
	//加载页面js
	$(document).ready(function(){
		initPage_edit();	
 
		$("#wtfl").change(function(){        
	  		$("#wtflA").empty();//清空下拉框
	  		$.getJSON("dictionary_do.asp?act=dic_sel", { pid:$("#wtfl").val() },  function(ret){ 
	  		  for (var jj = 0 ; jj< ret.length ; jj++){
	  			$("<option value='"+ret[jj].id+"'>"+ret[jj].c_txt+"</option>").appendTo("#wtflA");//添加下拉框的option
				}
			}); 
		});		
		$("#spfl").change(function(){        
	  		$("#spflA").empty();//清空下拉框
	  		$.getJSON("dictionary_do.asp?act=dic_sel", { pid:$("#spfl").val() },  function(ret){ 
	  		  for (var jj = 0 ; jj< ret.length ; jj++){
	  			$("<option value='"+ret[jj].id+"'>"+ret[jj].c_txt+"</option>").appendTo("#spflA");//添加下拉框的option
				}
			}); 
		});		
		$("#spflA").change(function(){        
	  		$("#spflB").empty();//清空下拉框
	  		$.getJSON("dictionary_do.asp?act=dic_sel", { pid:$("#spflA").val() },  function(ret){ 
	  		  for (var jj = 0 ; jj< ret.length ; jj++){
	  			$("<option value='"+ret[jj].id+"'>"+ret[jj].c_txt+"</option>").appendTo("#spflB");//添加下拉框的option
				}
			}); 
		});		
	});		 
	</script>
	
 
 
</div>



	
	
</div>
<!--footer页脚信息-->
<!--#include file="../Include/footer.asp"-->
<!--end footer页脚信息-->
</div>
</body>
</html>

<%
			Set rsObj = Nothing 

 '释放数据库链接
	call CloseConn	
	%>	
